from django.contrib import admin

from django.contrib import admin
from blog.models import Article
from blog.models import Tag


class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'category', 'date_time')
    search_fields = ('title', 'category', 'tag', 'content')
    list_filter = ('date_time', )
    raw_id_fields = ('tag', )
    date_hierarchy = 'date_time'


admin.site.register(Article, ArticleAdmin)
admin.site.register(Tag)